#include <a_samp>
#include <core>
#include <float>
#include <Dini>
#include <dudb>
#include <dutils>

#define Level1Commands1 "Level 1: /a [text], /clearchat, /kick, /slap, /akill, /warn, /getid, /seepms, /flip" // 9
#define Level1Commands2 ">>>>>>>> /freeze, /unfreeze /playerinfo, /asay, /ip, /mute, /ajail, /force, /flipme" // 9
#define Level2Commands1 "Level 2: /tele, /ban, /ann, /cnn, /giveweapon, /fuckup, /superslap" // 6
#define Level2Commands2 ">>>>>>>> /goto, /gethere, /eject, /sethealth, /setarmour, /healall, /armourall" // 7
#define Level3Commands1 "Level 3: /disarm, /disarmall, /explode, /time, /weather [weatherid], /getallhere, /explodeall" // 7
#define Level3Commands2 ">>>>>>>> /setmoney, /jetpack, /setname, /wantedlevel, /vehicle" // 5
#define Level4Commands1 "Level 4: /setlevel, /restart, /disarmall, /reloadbans, /reloadlogs, /mapname, /servername" // 7
#define Level4Commands2 ">>>>>>>> /sexplode, /sban, /skick" // 3

#define COLOR_GREY 0xAFAFAFAA
#define COLOR_PURPLE 0xC2A2DAAA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_DBLUE 0x2641FEAA
#define COLOR_BLUE 0x33AAFFFF
#define COLOR_GREEN 0x33AA33AA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xFF0000FF
#define COLOR_LIGHTRED 0xFF6347AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_LIGHTGREEN 0x9ACD32AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_YELLOW2 0xF5DEB3AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_PURPLE 0xC2A2DAAA
#define COLOR_DBLUE 0x2641FEAA
#define COLOR_CYAN 0x00FFFFAA
#define COLOR_SYSTEM 0xEFEFF7AA


#pragma unused ret_memcpy

forward IsStringAName(string[]);
forward GetPlayerID(string[]);
forward SendMessageToAdmins(color,const string[]);
forward Restart();
forward Unjail(giveplayerid);

new Mute[MAX_PLAYERS];
new level[MAX_PLAYERS];
new WarnedTimes[MAX_PLAYERS];
new logged[MAX_PLAYERS];
new mWarning[MAX_PLAYERS];

new Menu:Vehicle;


enum pInfo
{
    pAdmin,
    pPMs,
}

new PlayerInfo[MAX_PLAYERS][pInfo];

public OnFilterScriptInit()
{
	print(" | ********************************* |");
	print(" | ******* Andre's Admin 0.9 ******* |");
	print(" | ********************************* |");
}

public OnPlayerPrivmsg(playerid, recieverid, text[])
{
	new string[256];
	new PlayerName[MAX_PLAYER_NAME];
	new RecName[MAX_PLAYER_NAME];
	GetPlayerName(recieverid, RecName, sizeof(RecName));
	GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
	if(IsPlayerConnected(recieverid) && IsPlayerConnected(playerid))
	{
		format(string, sizeof(string), "AdmPM: PM from %s to %s: %s", PlayerName, RecName, text);
	 	for(new i = 0; i < MAX_PLAYERS; i++)
		{
			if(IsPlayerConnected(i) && PlayerInfo[i][pAdmin] >= 1 && i != playerid && i != recieverid)
			{
			    if(PlayerInfo[i][pPMs] == 1)
			    {
					SendClientMessage(i,  COLOR_CYAN, string);
				}
			}
		}
	    if(Mute[playerid] == 1) return SendClientMessage(playerid, COLOR_YELLOW, "You can't use PMs while muted. Please /report Your situation when You've been muted too long.");
	    if(recieverid != playerid)
	    {
			GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
			GetPlayerName(recieverid, RecName, sizeof(RecName));
			GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~Private message ~r~Sent~y~.", 3000, 3);
			GameTextForPlayer(recieverid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~ Private message ~r~Recieved~y~.", 3000, 3);
			PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
			PlayerPlaySound(recieverid,1057,0.0,0.0,0.0);
			format(string, sizeof(string), "# PM from %s(%i): %s", PlayerName, playerid, text);
			SendClientMessage(recieverid, COLOR_CYAN, string);
			format(string, sizeof(string), "# PM to %s(%i): %s", RecName, recieverid, text);
			SendClientMessage(playerid, COLOR_CYAN, string);
		}
	}
	else
	{
		format(string, sizeof(string), "There isn't anyone connected with ID %i", recieverid);
		SendClientMessage(playerid, COLOR_CYAN, string);
	}
	return 0;

}
// === [OnPlayerText] ===
public OnPlayerText(playerid,text[])
{
	new PlayerName[24], PlayerIP[20], string[128];
	GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
	GetPlayerIp(playerid, PlayerIP, sizeof(PlayerIP));
    if(Mute[playerid] == 1)
	{
	    if(mWarning[playerid] <= 9)
	    {
			SendClientMessage(playerid, COLOR_RED, "You can not talk while muted!");
			mWarning[playerid] += 1;
		}
		else if(mWarning[playerid] >= 10)
		{
			format(string, sizeof(string), "AdmCMD: %s(%i) was kicked. Reason: Exceeded mutewarning limit.");
			SendClientMessageToAll(COLOR_BLUE, string);
			format(string, sizeof(string), "INFO: %s(%i) was kicked. (IP: %s), Reason: Exceeded mutewarning limit.");
			for(new i = 0; i < MAX_PLAYERS; i++)
			{
			    if(PlayerInfo[i][pAdmin] >= 1 || IsPlayerAdmin(i))
			    {
			        SendClientMessage(i, COLOR_YELLOW, string);
				}
			}
			Kick(playerid);
		}
		return 0;
    }
	return 0;
}


public OnPlayerConnect(playerid)
{
	new PlayerName[24], file[256];
	format(file, sizeof(file), "\\AdminFS\\Accounts\\%s.ini", PlayerName);
	GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    if(!dini_Exists(file))
	{
		SendClientMessage(playerid, COLOR_BLUE, "You aren't registered, /register [password]");
	}
	else
	{
		SendClientMessage(playerid, COLOR_BLUE, "You are registered, /login [password]");
	}
	logged[playerid] = 0;
	level[playerid] = 0;
	PlayerInfo[playerid][pAdmin] = 0;
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	logged[playerid] = 0;
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[256], idx, tmp[256], tmp2[256];
	new giveplayer[24], sendername[24], file[256];
	new string[256], playername[256], giveplayerid;
	cmd = strtok(cmdtext, idx);
	GetPlayerName(playerid, sendername, sizeof(sendername));
	format(file, sizeof(file), "\\AdminFS\\Accounts\\%s.ini", sendername);
	PlayerInfo[playerid][pAdmin] = dini_Int(file, "AdminLevel");
	
	if(strcmp(cmd, "/seepms", true) == 0)
	{
	    if(logged[playerid] == 1)
	    {
	        if(PlayerInfo[playerid][pAdmin] >= 1)
			{
			    if(PlayerInfo[playerid][pPMs] == 0)
			    {
				    GetPlayerName(playerid, sendername, sizeof(sendername));
				    SendClientMessage(playerid, COLOR_BLUE, "You can now see PMs!");
				    PlayerInfo[playerid][pPMs] = 1;
				    dini_IntSet(file, "SeePMs", PlayerInfo[playerid][pPMs]);
				    for(new i=0; i <= MAX_PLAYERS; i++)
					{
					    if(IsPlayerConnected(i) && PlayerInfo[i][pAdmin] >= 1)
					    {
							format(string, sizeof(string), "AdmChat: %s(%i) has enabled his PM system. He can see players PMs now.", sendername, playerid);
							SendClientMessage(i, COLOR_BLUE, string);
						}
					}
				}
				else
				{
                    GetPlayerName(playerid, sendername, sizeof(sendername));
				    PlayerInfo[playerid][pPMs] = 0;
				    dini_IntSet(file, "SeePMs", PlayerInfo[playerid][pPMs]);
				    for(new i=0; i <= MAX_PLAYERS; i++)
					{
					    if(IsPlayerConnected(i) && PlayerInfo[i][pAdmin] >= 1)
					    {
							format(string, sizeof(string), "AdmChat: %s(%i) has disabled his PM system. He can't see players PMs anymore.", sendername, playerid);
							SendClientMessage(i, COLOR_BLUE, string);
						}
					}
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_CYAN, "You are not authorized to use this command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}

	if(strcmp(cmd,"/getid",true) == 0 || strcmp(cmd, "/id", true) == 0)
	{
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid,COLOR_DBLUE,"Correct Usage: /getid [part from the nick]");
			return 1;
		}
		format(string,sizeof(string),"Searched for: \"%s\": ",tmp);
		SendClientMessage(playerid,COLOR_RED,string);
		new found=0;
		for(new i=0; i <= MAX_PLAYERS; i++)
		{
			if(IsPlayerConnected(i))
			{
		  		new foundname[MAX_PLAYER_NAME];
		  		GetPlayerName(i, foundname, MAX_PLAYER_NAME);
				new namelen = strlen(foundname);
				new bool:searched=false;
		    	for(new pos=0; pos <= namelen; pos++)
				{
					if(searched != true)
					{
						if(strfind(foundname,tmp,true) == pos)
						{
			                found++;
							format(string,sizeof(string),"%d. %s (ID %d)",found,foundname,i);
							SendClientMessage(playerid, COLOR_GREEN ,string);
							searched = true;
						}
					}
				}
			}
		}
		return 1;
	}
	
	if(strcmp(cmd, "/register", true) == 0)
	{
	    new hour, minute, second, day, month, year;
		gettime(hour, minute, second);
		getdate(year, month, day);
	    tmp = strtok(cmdtext, idx);
 		GetPlayerName(playerid, playername, sizeof(playername));
        if(14 < strlen(tmp) || strlen(tmp) < 4)
		{
			SendClientMessage(playerid, COLOR_RED, "Error! You must use a password: Longer than 3, Shorter than 14 characters.");
			return 1;
		}
	    if(!strlen(tmp))
		{
			SendClientMessage(playerid, COLOR_GREY, "USAGE: /register [password]");
		}
		else
		{
			if(!dini_Exists(file))
			{
				dini_Create(file);
				dini_IntSet(file, "HashPW", udb_hash(tmp));
				dini_Set(file,"RegPW", tmp);
				dini_IntSet(file,"AdminLevel", 0);
				format(string, sizeof(string), "-AccServer- Account %s successfully registered (Password: %s)", sendername, tmp);
				SendClientMessage(playerid, COLOR_GREEN, string);
				format(string, sizeof(string), "-AccServer- Registration Date: %d/%d/%d (DD/MM/YY)", day, month, year);
				SendClientMessage(playerid, COLOR_GREEN, string);
				GameTextForPlayer(playerid, "~n~~n~~n~~g~Use ~w~/login~g~ now.", 3000, 3);
				PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
			}
			else
			{
				format(string, sizeof(string), "SERVER: \"%s\" is already registered on this server!", playername);
				SendClientMessage(playerid, COLOR_GREY, string);
			}
		}

		return 1;
	}
	
	if(strcmp(cmd, "/login", true) == 0)
	{
	    new AdminText[40];
		if(logged[playerid] == 1)
		{
		    SendClientMessage(playerid, COLOR_RED, "You already are logged in!");
		    return 1;
		}
	    tmp = strtok(cmdtext, idx);
 		GetPlayerName(playerid, playername, sizeof(playername));
	    if(!strlen(tmp))
	    {
			SendClientMessage(playerid, COLOR_GREY, "USAGE: /login [password]");
		}
		else
		{
			if(dini_Exists(file))
			{
				tmp2 = dini_Get(file, "HashPW");
			  	if(udb_hash(tmp) != strval(tmp2))
				{
	  			    new PlayerName[24];
	  			    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
	  			    format(string, sizeof(string), "Error! You have specified the wrong password for %s", PlayerName);
	  			    SendClientMessage(playerid, COLOR_RED, string);
				}
				else
				{
					logged[playerid] = 1;
					dini_Set(file, "RegPW", tmp);
		            PlayerInfo[playerid][pAdmin] = dini_Int(file, "AdminLevel");
					if(PlayerInfo[playerid][pAdmin] >= 1)
					{
						if(PlayerInfo[playerid][pAdmin] == 1) format(AdminText, sizeof(AdminText), "Admin Level 1 (Trial Moderator)");
						if(PlayerInfo[playerid][pAdmin] == 2) format(AdminText, sizeof(AdminText), "Admin Level 2 (Moderator)");
						if(PlayerInfo[playerid][pAdmin] == 3) format(AdminText, sizeof(AdminText), "Admin Level 3 (Administrator)");
						if(PlayerInfo[playerid][pAdmin] == 4) format(AdminText, sizeof(AdminText), "Admin Level 4 (Main Administrator)");
					}
					if(PlayerInfo[playerid][pAdmin] == 0)
					{
					    format(AdminText, sizeof(AdminText), "Regual RPG'er");
					}

		            GameTextForPlayer(playerid, "~b~Successfully logged in!",2000,1);
		            PlayerPlaySound(playerid,1057,0.0,0.0,0.0);

		            if(PlayerInfo[playerid][pAdmin] == 0)
		            {
		            	SetPlayerColor(playerid, COLOR_YELLOW);
	  					format(string, sizeof(string), "Logged in as: %s (Status: %s)", sendername, AdminText);
	  					SendClientMessage(playerid, COLOR_GREEN, string);
					}
					if(PlayerInfo[playerid][pAdmin] == 1)
				   	{
                  		SetPlayerColor(playerid, COLOR_RED);
	  				   	format(string, sizeof(string), "Logged in as: %s (Status: %s)", sendername, AdminText);
	  				   	SendClientMessage(playerid, COLOR_GREEN, string);
					}
					return 1;
				}
			}
			else
			{
			    format(string, sizeof(string), "The account %s, does not exist on this server. Please type /register [password] to create an account.", playername);
				SendClientMessage(playerid, COLOR_RED, string);
			}
		}
		return 1;
	}

	if(strcmp(cmd, "/adminhelp", true) == 0)
	{
	    if(logged[playerid] == 1)
	    {
		    if(PlayerInfo[playerid][pAdmin] >= 1)
		    {
		        new PlayerName[30];
		        GetPlayerName(playerid, PlayerName, 30);
				printf("[Command] %s has used /adminhelp & succeeded - The player is admin!", PlayerName);
				if(PlayerInfo[playerid][pAdmin] == 1)
				{
					SendClientMessage(playerid, COLOR_RED, ">>-+== Level 1 Admin commands =====================================================================================");
					SendClientMessage(playerid, COLOR_YELLOW, Level1Commands1);
					SendClientMessage(playerid, COLOR_YELLOW, Level1Commands2);
				}
				if(PlayerInfo[playerid][pAdmin] == 2)
				{
				    SendClientMessage(playerid, COLOR_RED, ">>-+== Level 2 Admin commands =====================================================================================");
			 		SendClientMessage(playerid, COLOR_YELLOW, Level1Commands1);
					SendClientMessage(playerid, COLOR_YELLOW, Level1Commands2);
					SendClientMessage(playerid, COLOR_YELLOW, Level2Commands1);
					SendClientMessage(playerid, COLOR_YELLOW, Level2Commands2);
				}
				if(PlayerInfo[playerid][pAdmin] == 3)
				{
				    SendClientMessage(playerid, COLOR_RED, ">>-+== Level 3 Admin commands =====================================================================================");
					SendClientMessage(playerid, COLOR_YELLOW, Level1Commands1);
					SendClientMessage(playerid, COLOR_YELLOW, Level1Commands2);
					SendClientMessage(playerid, COLOR_YELLOW, Level2Commands1);
					SendClientMessage(playerid, COLOR_YELLOW, Level2Commands2);
					SendClientMessage(playerid, COLOR_YELLOW, Level3Commands1);
					SendClientMessage(playerid, COLOR_YELLOW, Level3Commands2);
				}
				if(PlayerInfo[playerid][pAdmin] == 4)
				{
				    SendClientMessage(playerid, COLOR_RED, ">>-+== Level 4 Admin commands =====================================================================================");
				    SendClientMessage(playerid, COLOR_YELLOW, Level1Commands1);
					SendClientMessage(playerid, COLOR_YELLOW, Level1Commands2);
					SendClientMessage(playerid, COLOR_YELLOW, Level2Commands1);
					SendClientMessage(playerid, COLOR_YELLOW, Level2Commands2);
					SendClientMessage(playerid, COLOR_YELLOW, Level3Commands1);
					SendClientMessage(playerid, COLOR_YELLOW, Level3Commands2);
					SendClientMessage(playerid, COLOR_YELLOW, Level4Commands1);
					SendClientMessage(playerid, COLOR_YELLOW, Level4Commands2);
				}
				return 1;
			}
			else
			{
			    new PlayerName[30];
			    GetPlayerName(playerid, PlayerName, 30);
				printf("[Command] %s has used /adminhelp & FAILED - The player isn't admin", PlayerName);
	   			SendClientMessage(playerid, COLOR_CYAN, "You are not authorized to use this command!");
				return 1;
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
	}
	
	if(strcmp(cmd, "/wantedlevel", true) == 0 || strcmp(cmd, "/wanted", true) == 0)
	{
		new Level;
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /wantedlevel [id] [level]");
		giveplayerid = strval(tmp);
		
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /wantedlevel [id] [level]");
		Level = strval(tmp);
		
		if(Level >= 7) return SendClientMessage(playerid, COLOR_GREY, "Wrong usage: level from 0 to 6!");
		
		GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		
  		if(logged[playerid] == 1)
  		{
  		    if(PlayerInfo[playerid][pAdmin] >= 3)
  		    {
  		        if(IsPlayerConnected(giveplayerid))
  		        {
					format(string, sizeof(string), "AdmCMD: You have set %s(%i)'s wanted level to %d", giveplayer, giveplayerid, Level);
					SendClientMessage(playerid, COLOR_BLUE, string);
					format(tmp, sizeof(tmp), "AdmCMD: %s(%i) has set Your wanted level to %d", sendername, playerid, Level);
					SendClientMessage(giveplayerid, COLOR_BLUE, string);
					SetPlayerWantedLevel(giveplayerid, Level);
				}
				else
				{
				    format(string, sizeof(string), "%d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_RED, string);
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}
	
	if(strcmp(cmd, "/setskin", true) == 0)
	{
	    new Skin;
        tmp = strtok(cmdtext, idx);
		if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /wantedlevel [id] [level]");
		giveplayerid = strval(tmp);

		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /wantedlevel [id] [level]");
		Skin = strval(tmp);
		
		if(Skin >= 300) return SendClientMessage(playerid, COLOR_GREY, "Skins: 0 - 299");
		
		if(logged[playerid] == 0) return SendClientMessage(playerid, COLOR_RED, "You must be logged in to use this command!");
		if(PlayerInfo[playerid][pAdmin] >= 2)
		{
		    if(IsPlayerConnected(giveplayerid))
		    {
				format(string, sizeof(string), "AdmCMD: You have set %s(%i)'s skin to %d", sendername, playerid, Skin);
				SendClientMessage(playerid, COLOR_BLUE, string);
				SetPlayerSkin(giveplayerid, Skin);
			}
			else
			{
			    format(string, sizeof(string), "%d is not an active player.", giveplayerid);
				SendClientMessage(playerid, COLOR_RED, string);
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}
	
	if(strcmp(cmd, "/servername", true) == 0)
	{
	    tmp = strtok(cmdtext, idx);
	    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_DBLUE,"Correct Usage: /servername [new name]");
	    if(logged[playerid] == 1)
	    {
	        if(PlayerInfo[playerid][pAdmin] >= 4)
	        {
	            format(tmp,sizeof(tmp),"hostname %s",cmdtext[11]);
	            SendRconCommand(tmp);
	            GetPlayerName(playerid, sendername, sizeof(sendername));
	            format(string, sizeof(string), "AdmCMD: %s(%i) has changed server name to: %s",sendername, playerid, cmdtext[11]);
	            SendClientMessageToAll(COLOR_BLUE,string);
	        }
	        else
	        {
	            SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
	        }
	    }
	    else
	    {
	        SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
	    }
	    return 1;
	}
	
	if(strcmp(cmd, "/mapname", true) == 0)
	{
	    tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid, COLOR_DBLUE,"Correct Usage: /mapname [new name]");
			return 1;
		}
		if(logged[playerid] == 1)
		{
		    if(PlayerInfo[playerid][pAdmin] >= 4)
		    {
				format(tmp,sizeof(tmp),"mapname %s",cmdtext[8]);
				SendRconCommand(tmp);
				GetPlayerName(playerid, sendername, sizeof(sendername));
				format(string, sizeof(string), "AdmCMD: %s(%i) has changed maps name to: %s",sendername, playerid, cmdtext[8]);
				SendClientMessageToAll(COLOR_BLUE,string);
			}
			else
			{
			    SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}

	if(strcmp(cmd, "/explode", true) == 0)
	{
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 1)
		{
			SendClientMessage(playerid, COLOR_GREY, "Usage: /explode [playerid]");
			return 1;
		}
		giveplayerid = strval(tmp);
		GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		GetPlayerName(playerid, sendername, sizeof(sendername));
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 3)
			{
			    if(IsPlayerConnected(giveplayerid))
			    {
					format(string, sizeof(string), "AdmCMD: %s was exploded by %s",giveplayer, sendername);
					SendClientMessageToAll(COLOR_BLUE, string);
					SetPlayerHealth(giveplayerid, 10);
					new Float:boomx, Float:boomy, Float:boomz;
					GetPlayerPos(giveplayerid,boomx, boomy, boomz);
					CreateExplosion(boomx, boomy, boomz-1, 7, 10);
					CreateExplosion(boomx, boomy, boomz, 7, 10);
					CreateExplosion(boomx, boomy, boomz+1, 7, 10);
					CreateExplosion(boomx, boomy, boomz+2, 7, 10);
					new PlayerName[30];
					GetPlayerName(playerid, PlayerName, 30);
					printf("[Command] %s has used /explode to explode %s", PlayerName, giveplayer);
				}
				else
				{
				    format(string, sizeof(string), "%d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_RED, string);
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}
	
	if(strcmp(cmd, "/explodeall", true) == 0)
	{
		new Float:boomx, Float:boomy, Float:boomz;
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 3)
			{
			    for(new i = 0; i < MAX_PLAYERS; i++)
			    {
			        if(IsPlayerConnected(i))
			        {
						format(string, sizeof(string), "AdmCMD: Everyone was exploded by %s(%i)", sendername, playerid);
						SendClientMessageToAll(COLOR_BLUE, string);
						SetPlayerHealth(giveplayerid, 10);
						GetPlayerPos(i, boomx, boomy, boomz);
						CreateExplosion(boomx, boomy , boomz, 7, 10);
						new PlayerName[30];
						GetPlayerName(playerid, PlayerName, 30);
						printf("[Command] %s has used /explode to explode everyone", PlayerName);
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}
	
	if(strcmp(cmd, "/fuckup", true) == 0)
	{
	    tmp = strtok(cmdtext, idx);
	    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /fuckup [playerid]");
	    giveplayerid = strval(tmp);
	    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		GetPlayerName(playerid, sendername, sizeof(sendername));
		if(logged[playerid] == 1)
		{
		    if(PlayerInfo[playerid][pAdmin] >= 2)
		    {
		        if(IsPlayerConnected(playerid))
		        {
		            format(string, sizeof(string), "AdmCMD: %s(%i) was fucked up by %s(%i)", giveplayer, giveplayerid, sendername, playerid);
					SendClientMessageToAll(COLOR_BLUE, string);
					format(string, sizeof(string), "AdmCMD: %s(%i) has fucked you up.", sendername, playerid);
					SendClientMessage(giveplayerid, COLOR_BLUE, string);
					SetPlayerArmour(playerid, 0.0);
					SetPlayerHealth(playerid, 1.0);
					ResetPlayerWeapons(playerid);
					ResetPlayerMoney(playerid);
				}
				else
				{
				    format(string, sizeof(string), "%d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_RED, string);
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}
	
	if(strcmp(cmd, "/setname", true) == 0)
	{
		new tmpp[256];
		tmpp = strtok(cmdtext, idx);
		if(!strlen(tmpp))
		{
			SendClientMessage(playerid, COLOR_GREY, "Usage: /setname [playerid] [new nick]");
			return 1;
		}
		giveplayerid = strval(tmpp);
		tmp = strtok(cmdtext, idx);
		GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		GetPlayerName(playerid, sendername, sizeof(sendername));
		if(logged[playerid] == 1)
		{
		    if(PlayerInfo[playerid][pAdmin] >= 3)
		    {
		        if(IsPlayerConnected(giveplayerid))
		        {
					format(string, sizeof(string), "AdmCMD: You have changed %s(%i)'s name to %s", giveplayerid, tmp);
					SendClientMessage(playerid, COLOR_BLUE, string);
					SetPlayerName(giveplayerid, tmp);
				}
				else
				{
				    format(string, sizeof(string), "%d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_RED, string);
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
	  	return 1;
  	}

	if(strcmp(cmd, "/asay", true) == 0)
	{
		new length = strlen(cmdtext);
		GetPlayerName(playerid, sendername, sizeof(sendername));
		while ((idx < length) && (cmdtext[idx] <= ' '))
		{
			idx++;
		}
		new offset = idx;
		new result[64];
		while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
		{
			result[idx - offset] = cmdtext[idx];
			idx++;
		}
		result[idx - offset] = EOS;
		if(!strlen(result) && PlayerInfo[playerid][pAdmin] >= 1)
		{
			SendClientMessage(playerid, COLOR_GREY, "Usage: /asay [text]");
			return 1;
		}
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 1)
			{
				format(string, sizeof(string), "Admin %s: %s", sendername, result);
				SendClientMessageToAll(COLOR_BLUE,string);
				new PlayerName[30];
				GetPlayerName(playerid, PlayerName, 30);
				printf("[Command] %s has used /asay to send the message: %s", PlayerName, result);
	     	}
			else
			{
				SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
				return 1;
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}

 	if(strcmp(cmd, "/goto", true) == 0)
	{
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid, COLOR_GREY, "Usage: /goto [playerid]");
			return 1;
		}
		new Float:plocx,Float:plocy,Float:plocz;
		giveplayerid = strval(tmp);
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 2)
			{
				if(IsPlayerConnected(giveplayerid))
				{
				    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), "AdmCMD: You teleported Yourself to %s(%i)", giveplayer, giveplayerid);
					SendClientMessage(playerid, COLOR_BLUE, string);
					GetPlayerPos(giveplayerid, plocx, plocy, plocz);
					new intid = GetPlayerInterior(giveplayerid);
					SetPlayerInterior(playerid,intid);
					new PlayerName[30];
					GetPlayerName(playerid, PlayerName, 30);
					printf("[Command] %s has used /goto to go to %s", PlayerName, giveplayer);
					if (GetPlayerState(playerid) == 2)
					{
						new tmpcar = GetPlayerVehicleID(playerid);
						SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
					}
					else
					{
							SetPlayerPos(playerid,plocx,plocy+2, plocz);
					}
				}
				else
				{
				    format(string, sizeof(string), "%d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_RED, string);
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}

	if(strcmp(cmd, "/gethere", true) == 0)
	{
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid, COLOR_GREY, "Usage: /gethere [playerid]");
			return 1;
		}
		new Float:plocx,Float:plocy,Float:plocz;
		giveplayerid = strval(tmp);
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 2)
			{
			    if(IsPlayerConnected(giveplayerid))
			    {
				    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), "AdmCMD: You were teleported to %s(%i)",sendername,playerid);
					SendClientMessage(giveplayerid, COLOR_BLUE, string);
					format(string, sizeof(string), "AdmCMD: You teleported %s(%i) to Yourself", giveplayer, giveplayerid);
					SendClientMessage(playerid, COLOR_BLUE, string);
					GetPlayerPos(playerid, plocx, plocy, plocz);
					new intid = GetPlayerInterior(playerid);
					SetPlayerInterior(giveplayerid,intid);
					new PlayerName[30];
					GetPlayerName(playerid, PlayerName, 30);
					printf("[Command] %s has used /gethere to get %s", PlayerName, giveplayer);

					if (GetPlayerState(giveplayerid) == 2)
					{
						new tmpcar = GetPlayerVehicleID(giveplayerid);
						SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
					}
					else
					{
							SetPlayerPos(giveplayerid,plocx,plocy+2, plocz);
					}
				}
				else
				{
	                format(string, sizeof(string), "%d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_RED, string);
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
            SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}

	if(strcmp(cmd, "/getallhere", true) == 0)
	{
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 3)
			{
			    for(new i = 0; i < MAX_PLAYERS; i ++)
			    {
			        if(IsPlayerConnected(i))
			        {
						format(string, sizeof(string), "AdmCMD: %s has teleported everyone to himself", sendername);
						SendClientMessage(i, COLOR_BLUE, string);
						new Float:ix, Float:iy, Float:iz;
						GetPlayerPos(playerid, ix, iy, iz);
						SetPlayerInterior(i, GetPlayerInterior(playerid));
						SetPlayerPos(i, ix, iy, iz+1);
						new PlayerName[30];
						GetPlayerName(playerid, PlayerName, 30);
						printf("[Command] %s has used /getallhere to get all", PlayerName);
					}
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}

	if(strcmp(cmd, "/time", true) == 0)
	{
	    new time;
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /time [time]");
		time = strval(tmp);
		if(time >= 25) return SendClientMessage(playerid, COLOR_GREY, "Time from 0 to 23!");
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 3)
			{
				SetWorldTime(time);
				format(string, sizeof(string), "AdmCMD: %s(%i) has changed time to %d", sendername, playerid, time);
				SendClientMessageToAll(COLOR_BLUE, string);
			}
			else
			{
				SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}
	if(strcmp(cmd, "/vehicle", true) == 0 || strcmp(cmd, "/getcar", true) == 0)
	{
	    if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 3)
			{
			   	Vehicle = CreateMenu("AdminVehicles", 1, 20, 200, 200, 200);
				SetMenuColumnHeader(Vehicle, 0, "Vehicle:");
				AddMenuItem(Vehicle, 0, "Quad");
				AddMenuItem(Vehicle, 0, "Vortex");
				AddMenuItem(Vehicle, 0, "RC car");
				AddMenuItem(Vehicle, 0, "Sandking");
				AddMenuItem(Vehicle, 0, "Hydra");
				AddMenuItem(Vehicle, 0, "Infernus");
				AddMenuItem(Vehicle, 0, "Packer");
				AddMenuItem(Vehicle, 0, "Hotring");
				AddMenuItem(Vehicle, 0, "Mower");
				AddMenuItem(Vehicle, 0, "Monster");
				AddMenuItem(Vehicle, 0, "Camper");
				AddMenuItem(Vehicle, 0, "NRG-500");
	    		ShowMenuForPlayer(Vehicle,playerid);
	    		TogglePlayerControllable(playerid, 0);
			}
			else
			{
			    SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}

	if(strcmp(cmd, "/weather", true) == 0)
	{
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid, COLOR_GREY, "Usage: /weather [weather]");
			SendClientMessage(playerid, COLOR_DBLUE, "Weather IDs: /weatherids");
			return 1;
		}
		new weather;
		weather = strval(tmp);
		GetPlayerName(playerid, sendername, sizeof(sendername));
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 3)
			{
	            SetWeather(weather);
				format(string, sizeof(string), "AdmCMD: Admin %s set the weather to: %d",sendername,weather);
				SendClientMessageToAll(COLOR_BLUE, string);
				SendClientMessage(playerid, COLOR_DBLUE, "See wheater IDs at: /weatherids");
				new PlayerName[30];
				GetPlayerName(playerid, PlayerName, 30);
				printf("[Command] %s has used /weather to set weather to: %s", PlayerName, weather);
			}
			else
			{
				SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}

 	if(strcmp(cmd, "/weatherids", true) == 0 || strcmp(cmd, "/weathers", true) == 0)
	{
		if(PlayerInfo[playerid][pAdmin] >= 3)
		{
			SendClientMessage(playerid, COLOR_RED, ">>+-=================================== [Weather Ids: ] ================================");
			SendClientMessage(playerid, COLOR_YELLOW, ">>| 1 - Blue | 2 - Lighter Blue | 3 - Light (No color) | 4 - Even more lighter");
			SendClientMessage(playerid, COLOR_YELLOW, ">>| 5 - Normal Sun | 7 - (My PC = Beeped) | 8 - Rainy | 9 - Foggy | 10 - Standard weather");
			SendClientMessage(playerid, COLOR_YELLOW, ">>| 12 - Colourless, with alittle fog | 13 - Less foggy  | 15 - Little fog ");
			SendClientMessage(playerid, COLOR_YELLOW, ">>| 16 - Rainy | 17 - Hot | 19 - Sandstorm | 20 - Dark | 21 - Some very wierd weather ");
			SendClientMessage(playerid, COLOR_YELLOW, ">>| 23 - Atmosphere style (?) | 25 - Abit foggy | 27 - Abit \"White\" | 30 - Thunderstorm ");
			SendClientMessage(playerid, COLOR_YELLOW, ">>| 32 - Foggy | 33 - Hot | 35 - City weather | 37 - Warm | 38 - Even more city weather ");
			SendClientMessage(playerid, COLOR_YELLOW, ">>| 39 - Industrial weather | 40 - Yellow weather | 42 - Black fog | 43 - Industrial fog ");
			SendClientMessage(playerid, COLOR_YELLOW, ">>| 44 & 45 - Some wierd weather. -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- (c) IDs by PaoloP");
			SendClientMessage(playerid, COLOR_RED, ">>+-====================================================================================");
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
		}
		return 1;
	}
	if(strcmp(cmd,"/report",true) == 0)
	{
		tmp = strtok(cmdtext, idx);
		GetPlayerName(playerid, sendername, sizeof(sendername));
		GetPlayerName(giveplayerid, giveplayer, sizeof(sendername));
		if(!strlen(tmp))
		{
			SendClientMessage(playerid,COLOR_DBLUE,"Correct Usage: /report [id] [reason]");
			return 1;
		}
		giveplayerid = strval(tmp);
		if(IsPlayerConnected(giveplayerid))
		{
				new length = strlen(cmdtext);
				while ((idx < length) && (cmdtext[idx] <= ' ')) {
				idx++;
				}
				new offset = idx;
				new result[64];
				while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) {
				result[idx - offset] = cmdtext[idx];
				idx++;
				}
				result[idx - offset] = EOS;
				if(!strlen(result))
				{
					SendClientMessage(playerid,COLOR_WHITE,"SERVER: /report [id] [reason]");
					return 1;
				}
				GetPlayerName(giveplayerid, giveplayer, sizeof(sendername));
				format(string,sizeof(string),"AdmReport: Report on %s (id %d) by %s (id %d). [reason: %s]", giveplayer, giveplayerid, sendername, playerid,result);
				for(new i=0;i<MAX_PLAYERS;i++)
				{
					if(IsPlayerConnected(i) && PlayerInfo[i][pAdmin] >= 1)
					{
						SendClientMessage(i,COLOR_RED,string);
					}
				}
		}
		else
		{
			format(string, sizeof(string), "%d is not an active player.", giveplayerid);
			SendClientMessage(playerid, COLOR_RED, string);
		}
		return 1;
	}
	
 	if(strcmp(cmd, "/slap", true) == 0)
	{
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid, COLOR_GREY, "Usage: /slap [playerid]");
			return 1;
		}
		new Float:health;
		new Float:px, Float:py, Float:pz;
		giveplayerid = strval(tmp);
		GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		GetPlayerName(playerid, sendername, sizeof(sendername));
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 1)
			{
			    if(IsPlayerConnected(giveplayerid))
			    {
					GetPlayerHealth(giveplayerid, health);
					SetPlayerHealth(giveplayerid, health-5);
					GetPlayerPos(giveplayerid, px, py, pz);
					SetPlayerPos(giveplayerid, px, py, pz+5);
					format(string, sizeof(string), "AdmCMD: %s was slapped by %s",giveplayer, sendername);
					SendClientMessageToAll(COLOR_BLUE, string);
					new PlayerName[30];
					GetPlayerName(playerid, PlayerName, 30);
					printf("[Command] %s has used /slap to slap %s", PlayerName, giveplayer);
				}
				else
				{
				    format(string, sizeof(string), "%d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_RED, string);
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}

 	if(strcmp(cmd, "/superslap", true) == 0)
	{
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid, COLOR_GREY, "Usage: /SuperSlap [playerid]");
			return 1;
		}
		new Float:px, Float:py, Float:pz;
		giveplayerid = strval(tmp);
		GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		GetPlayerName(playerid, sendername, sizeof(sendername));
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 1)
			{
			    if(IsPlayerConnected(giveplayerid))
			    {
					GetPlayerPos(giveplayerid, px, py, pz);
					SetPlayerPos(giveplayerid, px, py, pz+90);
					format(string, sizeof(string), "AdmCMD: %s was SUPERslapped by %s",giveplayer, sendername);
					SendClientMessageToAll(COLOR_BLUE, string);
					new PlayerName[30];
					GetPlayerName(playerid, PlayerName, 30);
					printf("[Command] %s has used /superslap to superslap %s", PlayerName, giveplayer);
				}
				else
				{
				    format(string, sizeof(string), "%d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_RED, string);
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}

	if(strcmp(cmd, "/reloadbans", true) == 0)
	{
		if(logged[playerid] == 1)
		{
		    if(PlayerInfo[playerid][pAdmin] == 4)
		    {
				SendClientMessage(playerid, COLOR_RED, "You have successfully re-loaded bans!");
				SendRconCommand("reloadbans");
			}
			else
			{
			    SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}

	if(strcmp(cmd, "/reloadlogs", true) == 0)
	{
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] == 4)
			{
				SendRconCommand("reloadlogs");
				SendClientMessage(playerid, COLOR_RED, "You have successfully re-loaded logs!");
			}
			else
			{
			    SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}
	
	if(strcmp(cmd, "/loadfs", true) == 0)
	{
	    tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid, COLOR_GREY, "Usage: /loadfs [filterscript name]");
			return 1;
		}
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] == 4)
			{
				format(string,sizeof(string),"loadfs %s",tmp);
				SendRconCommand(string);
				format(string,sizeof(string),"AdmCMD: If the name You've entered for the FS, %s.amx is loaded",tmp);
				SendClientMessage(playerid,COLOR_BLUE,string);
			}
			else
			{
			    SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}

	if(strcmp(cmd, "/unloadfs", true) == 0)
	{
	    tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid, COLOR_GREY, "Usage: /unloadfs [filterscript name]");
			return 1;
		}
		if(logged[playerid] == 1)
		{
		    if(PlayerInfo[playerid][pAdmin] == 4)
		    {
				format(string,sizeof(string),"unloadfs %s",tmp);
				SendRconCommand(string);
				format(string,sizeof(string),"AdmCMD: If the name You've entered for the FS, %s.amx is unloaded",tmp);
				SendClientMessage(playerid,COLOR_BLUE,string);
			}
			else
			{
			    SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}

	if(strcmp(cmd, "/changemode", true) == 0)
	{
	    tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid, COLOR_GREY, "Usage: /changemode [mode name]");
			return 1;
		}
		if(logged[playerid] == 1)
		{
		    if(PlayerInfo[playerid][pAdmin] == 4)
		    {
				format(string,sizeof(string),"changemode %s",tmp);
				SendRconCommand(string);
				format(string,sizeof(string),"AdmCMD: Trying to change mode to %s...",tmp);
				SendClientMessage(playerid,COLOR_BLUE,string);
			}
			else
			{
			    SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}

    if(strcmp(cmd, "/giveweapon", true) == 0)
	{
		new weaponid;
		new giveammo;
		tmp = strtok(cmdtext, idx);
		if(logged[playerid] == 0)
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		if(!strlen(tmp))
		{
			SendClientMessage(playerid, COLOR_DBLUE,"Correct Usage: /giveweapon [id] [weaponid] [ammo]");
			return 1;
		}
        giveplayerid = strval(tmp);
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid, COLOR_DBLUE,"Correct Usage: /giveweapon [id] [weaponid] [ammo]");
			return 1;
		}
		weaponid = strval(tmp);
		if(weaponid < 0 || weaponid > 46)
		{
		    SendClientMessage(playerid, COLOR_RED, "ERROR: Invalid weapon ID.");
		    return 1;
		}
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			giveammo = 100000;
		}
		giveammo = strval(tmp);
		if(giveammo < 0 || giveammo > 100000)
		{
		    SendClientMessage(playerid, COLOR_RED, "ERROR: Invalid ammo.");
		    return 1;
		}
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 3)
			{
			    if(IsPlayerConnected(giveplayerid))
			    {
					GivePlayerWeapon(giveplayerid, weaponid, giveammo);
					GetPlayerName(playerid, sendername, sizeof(sendername));
					new weaponname[20];
					GetWeaponName(weaponid, weaponname, sizeof(weaponname));
					GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					format(string,sizeof(string),"AdmCMD: You gave %s \"%s\" with %d ammo",giveplayer, weaponname, giveammo);
					SendClientMessage(playerid, COLOR_BLUE, string);
					format(string,sizeof(string),"AdmCMD: Admin %s gave you \"%s\" with %d ammo",sendername, weaponname, giveammo);
					SendClientMessage(giveplayerid, COLOR_BLUE, string);
				}
				else
				{
				    format(string, sizeof(string), "%d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_RED, string);
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
            SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}

	if(strcmp(cmd, "/eject", true) == 0)
	{
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid,COLOR_DBLUE,"Correct Usage: /eject [playerid]");
			return 1;
		}
		giveplayerid = strval(tmp);
		GetPlayerName(playerid, sendername, sizeof(sendername));
	    GetPlayerName(giveplayerid, giveplayer, sizeof(sendername));
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 2)
			{
				if(IsPlayerConnected(giveplayerid))
				{
				    if(playerid != giveplayerid)
				    {
					    if(IsPlayerInAnyVehicle(giveplayerid))
					    {
					        RemovePlayerFromVehicle(giveplayerid);
					        format(string, sizeof(string), "Administrator %s has ejected You!", sendername);
					        SendClientMessage(giveplayerid, COLOR_RED, string);
					        format(string, sizeof(string), "AdmCMD: %s has been ejected by %s", giveplayer, sendername);
					        SendClientMessageToAll(COLOR_BLUE, string);
					        return 1;
						}
						else
						{
							format(string, sizeof(string), "Error! %s isn't in a vehicle!");
							SendClientMessage(playerid, COLOR_RED, string);
							return 1;
						}
					}
					else if(playerid == giveplayerid)
					{
					    if(IsPlayerInAnyVehicle(playerid))
					    {
					        RemovePlayerFromVehicle(playerid);
					        SendClientMessage(playerid, COLOR_RED, "You have ejected yourself!");
					        format(string, sizeof(string), "AdmCMD: %s has been ejected by %s", giveplayer, sendername);
					        SendClientMessageToAll(COLOR_BLUE, string);
					        return 1;
						}
						else
						{
							SendClientMessage(playerid, COLOR_RED, "Error! You aren't in a vehicle!");
							return 1;
						}
					}
				}
				else
				{
				    format(string, sizeof(string), "%d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_RED, string);
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}

		return 1;
	}

	if(strcmp(cmd, "/sethealth", true) == 0)
	{
		new health;
		GetPlayerName(playerid, sendername, sizeof(sendername));
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid,COLOR_DBLUE,"Correct Usage: /sethealth [id] [health]");
			return 1;
		}
		giveplayerid = strval(tmp);
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid,COLOR_DBLUE,"Correct Usage: /sethealth [id] [health]");
			return 1;
		}
		health = strval(tmp);
		if(health < 0 || health > 100)
		{
		    SendClientMessage(playerid,COLOR_RED,"ERROR: Invalid health.");
		    return 1;
		}
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 2)
			{
				if(IsPlayerConnected(giveplayerid))
				{
	    			SetPlayerHealth(giveplayerid,health);
	    			GetPlayerName(giveplayerid, giveplayer,sizeof(giveplayer));
					format(string,sizeof(string),"AdmCMD: You have been set %s 's health to %d",giveplayer, health);
					SendClientMessage(playerid,COLOR_RED,string);
					format(string,sizeof(string),"AdmCMD: Admin %s set your health to %d",sendername, health);
					SendClientMessage(giveplayerid,COLOR_RED,string);
					new PlayerName[30];
					GetPlayerName(playerid, PlayerName, 30);
					printf("[Command] %s has used /sethealth to set %s's health to: %d", PlayerName, giveplayer, health);
				}
				else
				{
				    format(string, sizeof(string), "%d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_RED, string);
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}
	
	if(strcmp(cmd, "/force", true) == 0)
	{
		tmp = strtok(cmdtext, idx);
		if	(!strlen(tmp))
		{
			SendClientMessage(playerid, COLOR_GREEN, "USAGE: /force [playerid]");
			return 1;
		}
		giveplayerid = strval(tmp);
		GetPlayerName(playerid, sendername, sizeof(sendername));
		GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		if(logged[playerid] == 1)
		{
		    if(PlayerInfo[playerid][pAdmin] >= 1)
		    {
		        if(IsPlayerConnected(giveplayerid))
		        {
					format(string, sizeof(string), "AdmCMD: You have forced %s(%i) to class selection", giveplayer, giveplayerid);
					SendClientMessage(playerid, COLOR_BLUE, string);
					SetPlayerHealth(giveplayerid, 0.0);
					ForceClassSelection(giveplayerid);
					format(string, sizeof(string), "AdmCMD: %s(%i) has forced You to class selection", sendername, playerid);
					SendClientMessage(giveplayerid, COLOR_BLUE, string);
				}
				else
				{
				    format(string, sizeof(string), "%d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_RED, string);
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}
	
	if(strcmp(cmd, "/flip", true) == 0)
	{
	    tmp = strtok(cmdtext, idx);
	    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /flip [playerid]");
	    giveplayerid = strval(tmp);
		if(logged[playerid] == 1)
		{
		    if(PlayerInfo[playerid][pAdmin] >= 1)
		    {
		        if(IsPlayerConnected(giveplayerid))
		        {
		            if(IsPlayerInAnyVehicle(giveplayerid))
		            {
		                new Float:X, Float:Y, Float:Z;
						SetCameraBehindPlayer(giveplayerid);
						GetPlayerPos(giveplayerid, X, Y, Z);
		                SetVehiclePos(GetPlayerVehicleID(giveplayerid), X, Y, Z);
		                SetVehicleZAngle(GetPlayerVehicleID(giveplayerid), 0);
		                GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		                format(string, sizeof(string), "AdmCMD: You have flipped %s(%i)", giveplayer, giveplayerid);
					}
					else
					{
					    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					    format(string, sizeof(string), "Error! %s(%i) isn't in a vehicle!", giveplayer, giveplayerid);
					    SendClientMessage(playerid, COLOR_RED, string);
					}
				}
				else
				{
				    format(string, sizeof(string), "%d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_RED, string);
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
			SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}
	
	if(strcmp(cmd, "/flipme", true) == 0)
	{
	    new Float:X, Float:Y, Float:Z;
		if(logged[playerid] == 1)
		{
		    if(PlayerInfo[playerid][pAdmin] >= 1)
			{
   				if(IsPlayerInAnyVehicle(playerid))
   				{
					SetCameraBehindPlayer(playerid);
					GetPlayerPos(playerid, X, Y, Z);
	                SetVehiclePos(GetPlayerVehicleID(playerid), X, Y, Z);
	                SetVehicleZAngle(GetPlayerVehicleID(playerid), 0);
				}
				else
				{
				   	SendClientMessage(playerid, COLOR_RED, "You must be in a vehicle!");
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
			SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}
	
	if(strcmp(cmd, "/fix", true) == 0)
	{
		if(logged[playerid] == 1)
		{
		    if(PlayerInfo[playerid][pAdmin] >= 1)
			{
   				if(IsPlayerInAnyVehicle(playerid))
   				{
					SetVehicleHealth(GetPlayerVehicleID(playerid), 1000);
				}
				else
				{
				   	SendClientMessage(playerid, COLOR_RED, "You must be in a vehicle!");
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
			SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}
	
	if(strcmp(cmd, "/setarmour", true) == 0)
	{
		new armor;
		GetPlayerName(playerid, sendername, sizeof(sendername));
		GetPlayerName(giveplayerid, giveplayer,sizeof(giveplayer));
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid,COLOR_DBLUE,"Correct Usage: /setarmour [id] [armor]");
			return 1;
		}
		giveplayerid = strval(tmp);
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid,COLOR_DBLUE,"Correct Usage: /setarmour [id] [armor]");
			return 1;
		}
		armor = strval(tmp);
		if(armor < 0 || armor > 100)
		{
		    SendClientMessage(playerid,COLOR_RED,"ERROR: Invalid armor.");
		    return 1;
		}
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 2)
			{
				if(IsPlayerConnected(giveplayerid))
				{
	    			SetPlayerArmour(giveplayerid, armor);
	    			GetPlayerName(giveplayerid, giveplayer,sizeof(giveplayer));
					format(string,sizeof(string),"AdmCMD: You have been set %s 's armour to %d",giveplayer, armor);
					SendClientMessage(playerid,COLOR_RED,string);
					format(string,sizeof(string),"AdmCMD: Admin %s set your armour to %d",sendername, armor);
					SendClientMessage(giveplayerid,COLOR_RED,string);
					new PlayerName[30];
					GetPlayerName(playerid, PlayerName, 30);
					printf("[Command] %s has used /setarmor to set %s's armor to: %d", PlayerName, giveplayer, armor);
				}
				else
				{
				    format(string, sizeof(string), "%d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_RED, string);
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}
	
	if(strcmp(cmd, "/healall", true) == 0)
	{
	    if(logged[playerid] == 1)
	    {
	        if(PlayerInfo[playerid][pAdmin] >= 2)
	        {
	            for(new i = 0; i < MAX_PLAYERS; i ++)
				{
				    if(IsPlayerConnected(i))
				    {
					    SetPlayerHealth(i, 100);
					    format(string, sizeof(string), "AdmCMD: %s has healed everyone", sendername);
					    SendClientMessage(i, COLOR_BLUE, string);
					}
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}

	if(strcmp(cmd, "/playerinfo", true) == 0 || strcmp(cmd, "/stats", true) == 0)
	{
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 1)
		{
			SendClientMessage(playerid, COLOR_GREY, "Usage: /playerinfo [playerid]");
			return 1;
		}
		giveplayerid = strval(tmp);
		if(logged[playerid] == 0)
		{
			SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		GetPlayerName(playerid, sendername, sizeof(sendername));
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 1)
			{
				if(IsPlayerConnected(giveplayerid))
				{
				    new Float:health;
				    new Float:armour;
					new intr = GetPlayerInterior(giveplayerid);
					GetPlayerHealth(giveplayerid,health);
					GetPlayerArmour(giveplayerid,armour);
					new ammo = GetPlayerAmmo(giveplayerid);
					new score = GetPlayerScore(giveplayerid);
					new skin = GetPlayerSkin(giveplayerid);
					new money = GetPlayerMoney(giveplayerid);
					new playerip[256];
					GetPlayerIp(giveplayerid, playerip, sizeof(playerip));
					new ping = GetPlayerPing(giveplayerid);
					if(logged[giveplayerid] == 0)
					{
						format(string, sizeof(string),"Information on player %s (ID: %i)(Player isn't logged in) :",giveplayer, giveplayerid);
						SendClientMessage(playerid, COLOR_BLUE, string);
					}
					else
					{
						format(string, sizeof(string),"Information on player %s (ID: %i) :",giveplayer, giveplayerid);
						SendClientMessage(playerid, COLOR_BLUE, string);
					}
					format(string, sizeof(string), "Health [%.1f] | Armour [%.1f] | Money [%d] | Interior [%d] | IP [%s]",health, armour, money, intr,playerip);
					SendClientMessage(playerid, COLOR_RED,string);
					format(string, sizeof(string), "Ammo [%d] | Score[%d] | Skin [%d] | Ping [%d] | Times Warned: %d",ammo, score, skin, ping, WarnedTimes);
					SendClientMessage(playerid, COLOR_RED,string);
					new PlayerName[30];
					GetPlayerName(playerid, PlayerName, 30);
					printf("[Command] %s has used /playerinfo to see information on player %s", PlayerName, giveplayer);
				}
				else
				{
				    format(string, sizeof(string), "%d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_RED, string);
				}
			}
			else
			{
	            SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
	            return 1;
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}

	if(strcmp(cmd, "/restart", true) == 0 || strcmp(cmd, "/gmx", true) == 0)
	{
		if(logged[playerid] == 1)
		{
		    if(PlayerInfo[playerid][pAdmin] >= 4)
		    {
		        format(string, sizeof(string), "AdmCMD: %s has restarted the server, please wait");
		        SendClientMessageToAll(COLOR_RED, string);
		        SetTimerEx("Restart", 5000, 0, "i", playerid);
				new PlayerName[30];
				GetPlayerName(playerid, PlayerName, 30);
				printf("[Command] %s has used /restart to restart the server", PlayerName);
			}
			else
			{
			    SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}

	if(strcmp(cmd, "/ip", true) == 0)
	{
	    tmp = strtok(cmdtext, idx);
		if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 1)
		{
			SendClientMessage(playerid, COLOR_GREY, "Usage: /ip [playerid]");
			return 1;
		}
		giveplayerid = strval(tmp);
		GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		GetPlayerName(playerid, sendername, sizeof(sendername));
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 1)
			{
			    if(IsPlayerConnected(giveplayerid))
			    {
					new playerip[256];
					GetPlayerIp(giveplayerid, playerip, sizeof(playerip));
					format(string, sizeof(string),"AdmCMD: Checked IP on %s(%i): %s ",giveplayer, giveplayerid, playerip);
					SendClientMessage(playerid, COLOR_BLUE, string);
					new PlayerName[30];
					GetPlayerName(playerid, PlayerName, 30);
					printf("[Command] %s has used /ip to check %s's IP", PlayerName, giveplayer);
				}
				else
				{
				    format(string, sizeof(string), "%d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_RED, string);
				}
			}
			else
			{
	            SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
	            return 1;
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}

	if(strcmp(cmd, "/givemoney", true) == 0)
	{
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 3)
		{
			SendClientMessage(playerid, COLOR_GREY, "Usage: /givemoney [playerid] [amount]");
			return 1;
		}
		new money;
		giveplayerid = strval(tmp);
		if(logged[playerid] == 0)
		{
			SendClientMessage(playerid, COLOR_RED, "You must be logged in to use this command!");
			return 1;
		}
		tmp = strtok(cmdtext, idx);
		money = strval(tmp);
		GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		GetPlayerName(playerid, sendername, sizeof(sendername));
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 3)
			{
				GivePlayerMoney(giveplayerid, money);
				format(string, sizeof(string), "AdmCMD: You sent %s(%i) $%d", giveplayer,giveplayerid, money);
				SendClientMessage(playerid,COLOR_BLUE, string);
				format(string, sizeof(string), "AdmCMD: You received $%d from Admin %s", money,sendername);
				SendClientMessage(giveplayerid,COLOR_BLUE, string);
				new PlayerName[30];
				GetPlayerName(playerid, PlayerName, 30);
				printf("[Command] %s has used /givemoney to give %s $%s", PlayerName, giveplayer, money);
			}
			else
			{
	            SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
	 			return 1;
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}
	
	if(strcmp(cmd, "/setmoney", true) == 0)
	{
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 3)
		{
			SendClientMessage(playerid, COLOR_GREY, "Usage: /setmoney [playerid] [amount]");
			return 1;
		}
		new money;
		giveplayerid = strval(tmp);
		if(logged[playerid] == 0)
		{
			SendClientMessage(playerid, COLOR_RED, "You must be logged in to use this command!");
			return 1;
		}
		tmp = strtok(cmdtext, idx);
		money = strval(tmp);
		GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		GetPlayerName(playerid, sendername, sizeof(sendername));
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 3)
			{
			    ResetPlayerMoney(giveplayerid);
				GivePlayerMoney(giveplayerid, money);
				format(string, sizeof(string), "AdmCMD: You set %s(%i)'s money to $%d", giveplayer,giveplayerid, money);
				SendClientMessage(playerid,COLOR_BLUE, string);
				format(string, sizeof(string), "AdmCMD: Admin %s has set Your money to %d", sendername, money);
				SendClientMessage(giveplayerid,COLOR_BLUE, string);
				new PlayerName[30];
				GetPlayerName(playerid, PlayerName, 30);
				printf("[Command] %s has used /setmoney to set %s's money to $%s", PlayerName, giveplayer, money);
			}
			else
			{
	            SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
	 			return 1;
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}

	if(strcmp(cmd,"/kick",true) == 0)
	{
	    tmp = strtok(cmdtext, idx);
	    GetPlayerName(playerid, sendername, sizeof(sendername));
		if(!strlen(tmp))
		{
			SendClientMessage(playerid,COLOR_BLUE, "Correct Usage: /kick [id] [reason]");
			return 1;
		}
        giveplayerid = strval(tmp);
		giveplayerid = strval(tmp);
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 1)
			{
				if(IsPlayerConnected(giveplayerid))
				{
					new length = strlen(cmdtext);
					while ((idx < length) && (cmdtext[idx] <= ' ')) {
					idx++;
					}
					new offset = idx;
					new result[64];
					while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) {
					result[idx - offset] = cmdtext[idx];
					idx++;
					}
					result[idx - offset] = EOS;
					if(!strlen(result))
					{
						result = "No reason";
					}
					GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					format(string, sizeof(string), "AdmCMD: %s was kicked by admin %s for: %s", giveplayer, sendername, result);
					SendClientMessageToAll(COLOR_BLUE, string);
					Kick(giveplayerid);
					new PlayerName[30];
					GetPlayerName(playerid, PlayerName, 30);
					printf("[Command] %s has used /kick to kick %s for: %s", PlayerName, giveplayer, result);
				}
				else
				{
				    format(string, sizeof(string), "%d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_RED, string);
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}
	
	if(strcmp(cmd,"/skick",true) == 0)
	{
	    tmp = strtok(cmdtext, idx);
	    GetPlayerName(playerid, sendername, sizeof(sendername));
		if(!strlen(tmp))
		{
			SendClientMessage(playerid,COLOR_BLUE, "Correct Usage: /skick [id] [reason]");
			return 1;
		}
        giveplayerid = strval(tmp);
		giveplayerid = strval(tmp);
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 1)
			{
				if(IsPlayerConnected(giveplayerid))
				{
					new length = strlen(cmdtext);
					while ((idx < length) && (cmdtext[idx] <= ' ')) {
					idx++;
					}
					new offset = idx;
					new result[64];
					while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) {
					result[idx - offset] = cmdtext[idx];
					idx++;
					}
					result[idx - offset] = EOS;
					if(!strlen(result))
					{
						result = "No reason";
					}
					GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					Kick(giveplayerid);
					new PlayerName[30];
					GetPlayerName(playerid, PlayerName, 30);
					printf("[Command] %s has used /skick to silently kick %s for: %s", PlayerName, giveplayer, result);
				}
				else
				{
				    format(string, sizeof(string), "%d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_RED, string);
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}
	
	if(strcmp(cmd, "/jetpack", true) == 0)
	{
	    if(logged[playerid] == 1)
	    {
	        if(PlayerInfo[playerid][pAdmin] >= 3)
	        {
	            SetPlayerSpecialAction(playerid, 2);
	            SendClientMessage(playerid, COLOR_BLUE, "AdmCMD: You've created a jetpack!");
			}
			else
			{
			    SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
            SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}

	if(strcmp(cmd, "/warn", true) == 0)
	{
		new str[256];
		tmp = strtok(cmdtext, idx);
		tmp2 = strtok(cmdtext, idx);

		if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 1)
		{
			SendClientMessage(playerid, COLOR_GREY, "Usage: /warn [PlayerID] [Reason]");
			return 1;
		}
		giveplayerid = strval(tmp);
		giveplayerid = strval(tmp);
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 1)
			{
				if(WarnedTimes[giveplayerid] == 0)
				{
					WarnedTimes[giveplayerid]+=1;
					GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					GetPlayerName(playerid, sendername, sizeof (sendername));
					format(str, sizeof (str), "AdmCMD: %s was warned by %s for: %s [1/3 Warnings]", giveplayer, sendername, cmdtext[8]);
					SendClientMessageToAll(COLOR_BLUE, str);
					print(str);
					return 1;
				}
				if(WarnedTimes[giveplayerid] == 1)
				{
				    WarnedTimes[giveplayerid]+=1;
					GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					GetPlayerName(playerid, sendername, sizeof (sendername));
					format(str, sizeof (str), "AdmCMD: %s was warned by %s for: %s [2/3 Warnings]", giveplayer, sendername, cmdtext[8]);
					SendClientMessageToAll(COLOR_BLUE, str);
					print(str);
					return 1;
				}
				else if(WarnedTimes[giveplayerid] == 2)
				{
					GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					GetPlayerName(playerid, sendername, sizeof (sendername));
					format(str, sizeof (str), "AdmCMD: %s was kicked by %s for: %s [3/3 Warnings]", giveplayer, sendername, cmdtext[8]);
					SendClientMessageToAll(COLOR_BLUE, str);
					Kick(giveplayerid);
					return 1;
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
				return 1;
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
	}

	if(strcmp(cmd, "/freeze", true) == 0)
	{
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /freeze");
        giveplayerid = strval(tmp);
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 1)
			{
			    if(IsPlayerConnected(giveplayerid))
			    {
					GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					GetPlayerName(playerid, sendername, sizeof(sendername));
					TogglePlayerControllable(giveplayerid, 0);
					format(string, sizeof(string), "AdmCMD: %s was frozen by %s.",giveplayer, sendername);
					SendClientMessageToAll(COLOR_BLUE, string);
					new PlayerName[30];
					GetPlayerName(playerid, PlayerName, 30);
					printf("[Command] %s has used /freeze to freeze %s", PlayerName, giveplayer);
					return 1;
				}
				else
				{
				    format(string, sizeof(string), "%d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_BLUE, string);
				}
			}
			else
			{
	 			SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
	 			return 1;
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}

	if(strcmp(cmd, "/unfreeze", true) == 0)
	{
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /unfreeze");
        giveplayerid = strval(tmp);
		if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 1)
		{
			SendClientMessage(playerid, COLOR_GREY, "Usage: /unfreeze [playerid]");
			return 1;
		}
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 1)
			{
			    if(IsPlayerConnected(giveplayerid))
			    {
		      		GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					GetPlayerName(playerid, sendername, sizeof(sendername));
					TogglePlayerControllable(giveplayerid, 1);
					format(string, sizeof(string), "AdmCMD: %s was thawed by %s", giveplayer,sendername);
					SendClientMessageToAll(COLOR_BLUE, string);
					new PlayerName[30];
					GetPlayerName(playerid, PlayerName, 30);
					printf("[Command] %s has used /unfreeze to unfreeze(thaw) %s", PlayerName, giveplayer);
					return 1;
				}
				else
				{
				    format(string, sizeof(string), "%d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_RED, string);
				}
			}
			else
			{
	 			SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
	 			return 1;
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}

	if(strcmp(cmd, "/setadmin", true) == 0 || strcmp(cmd, "/setlevel", true) == 0)
	{
		tmp = strtok(cmdtext, idx);
		giveplayerid = strval(tmp);
		if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 1)
		{
			SendClientMessage(playerid, COLOR_GREY, "Usage: /setadmin [playerid] [level]");
			return 1;
		}
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 1)
		{
			SendClientMessage(playerid, COLOR_GREY, "Usage: /setadmin [playerid] [level]");
			return 1;
		}
		PlayerInfo[playerid][pAdmin] = dini_Int(udb_encode(sendername), "level");
		level[playerid] = strval(tmp);
		if(level[playerid] < 0)
		{
			SendClientMessage(playerid, COLOR_RED, "Invalid Admin Level");
            return 1;
		}
		if(level[playerid] > 4)
		{
			SendClientMessage(playerid, COLOR_RED, "Invalid Admin Level");
            return 1;
		}
		if(level[playerid] == PlayerInfo[giveplayerid][pAdmin])
		{
            format(string, sizeof(string), "That player already has level %d admin privileges.", level[playerid]);
            SendClientMessage(playerid, COLOR_BLUE, string);
            return 1;
		}
		if(logged[playerid] == 1)
		{
			if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 4)
			{
			    if(IsPlayerConnected(giveplayerid))
			    {
			        if(logged[giveplayerid] == 0)
					{
						SendClientMessage(playerid, COLOR_RED, "The player You're setting rights to must be logged in!");
						return 1;
					}
					else
					{
						GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						dini_IntSet(udb_encode(giveplayer), "level", level[playerid]);
						format(string, sizeof(string), "You have given %s level %d admin powers.", giveplayer, level[playerid]);
						SendClientMessage(playerid, COLOR_BLUE, string);
						format(string, sizeof(string), "You were made a level %d admin by %s (id: %d).", level[playerid], sendername, playerid);
						SendClientMessage(giveplayerid, COLOR_BLUE, string);
						PlayerInfo[giveplayerid][pAdmin] = dini_Int(udb_encode(giveplayer), "level");
						new PlayerName[30];
						GetPlayerName(playerid, PlayerName, 30);
						printf("[Command] %s has used /setadmin to set %s ' level to: %d", PlayerName, giveplayer, level[playerid]);
					}
				}
				else
				{
				    format(string, sizeof(string), "%d is not an active player ID number.", giveplayerid);
	            	SendClientMessage(playerid, COLOR_RED, string);
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}
	
	if(strcmp(cmd,"/ban",true) == 0)
	{
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid, COLOR_GREY, "Usage: /ban [id] [reason]");
			return 1;
		}
		giveplayerid = strval(tmp);
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 2)
			{
				if(IsPlayerConnected(giveplayerid))
				{
					new length = strlen(cmdtext);
					while ((idx < length) && (cmdtext[idx] <= ' ')) {
					idx++;
					}
					new offset = idx;
					new result[64];
					while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) {
					result[idx - offset] = cmdtext[idx];
					idx++;
					}
					result[idx - offset] = EOS;
					if(!strlen(result))
					{
						SendClientMessage(playerid, COLOR_RED, "You can only ban with proper reason!");
					}
					else
					{
						GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
						format(string, sizeof(string), "AdmCMD: %s was banned by admin %s for: %s", giveplayer, sendername, result);
						SendClientMessageToAll(COLOR_BLUE, string);
						BanEx(giveplayerid, result);
						new PlayerName[30];
						GetPlayerName(playerid, PlayerName, 30);
						printf("[Command] %s has used /ban to ban %s for: %s", PlayerName, giveplayer, result);
					}
				}
				else
				{
				    format(string, sizeof(string), "%d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_RED, string);
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
				return 1;
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}

	if(strcmp(cmd,"/sban",true) == 0)
	{
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid, COLOR_GREY, "Usage: /sban [id] [reason]");
			return 1;
		}
		giveplayerid = strval(tmp);
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 2)
			{
				if(IsPlayerConnected(giveplayerid))
				{
					new length = strlen(cmdtext);
					while ((idx < length) && (cmdtext[idx] <= ' ')) {
					idx++;
					}
					new offset = idx;
					new result[64];
					while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) {
					result[idx - offset] = cmdtext[idx];
					idx++;
					}
					result[idx - offset] = EOS;
					if(!strlen(result))
					{
						result = "No reason";
					}
					GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					BanEx(giveplayerid, result);
					new PlayerName[30];
					GetPlayerName(playerid, PlayerName, 30);
					printf("[Command] %s has used /sban to silently ban %s for: %s", PlayerName, giveplayer, result);
				}
				else
				{
				    format(string, sizeof(string), "%d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_RED, string);
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
				return 1;
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}

	if(strcmp(cmd, "/mute", true) == 0)
	{
		tmp = strtok(cmdtext, idx);
		giveplayerid = strval(tmp);
		if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 1)
		{
			SendClientMessage(playerid, COLOR_GREY, "Usage: /mute [ID]");
			return 1;
		}
		giveplayerid = strval(tmp);
		GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		GetPlayerName(playerid, sendername, sizeof(sendername));
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 1)
			{
				if(IsPlayerConnected(giveplayerid))
				{
					if(Mute[giveplayerid] == 0)
					{
						Mute[giveplayerid] = 1;
						format(string, sizeof(string), "AdmCMD: %s was muted by %s",giveplayer ,sendername);
						SendClientMessageToAll(COLOR_BLUE, string);
						new PlayerName[30];
						GetPlayerName(playerid, PlayerName, 30);
						printf("[Command] %s has used /mute to mute %s", PlayerName, giveplayer);
					}
					else
					{
						Mute[giveplayerid] = 0;
						format(string, sizeof(string), "AdmCMD: %s was un-muted by %s",giveplayer ,sendername);
						SendClientMessageToAll(COLOR_BLUE, string);
						new PlayerName[30];
						GetPlayerName(playerid, PlayerName, 30);
						printf("[Command] %s has used /mute to unmute %s", PlayerName, giveplayer);
					}
				}
				else
				{
					format(string, sizeof(string), "%d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_RED, string);
				}
			}
			else
			{
	 			SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
	 			return 1;
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}

	if(strcmp(cmd, "/announce", true) == 0 || strcmp(cmd, "/ann", true) == 0)
	{
        tmp = strtok(cmdtext, idx, strlen(cmdtext));
 		if (!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 2)
  		{
			SendClientMessage(playerid, COLOR_GREY, "Usage: /announce [message]");
 			return 1;
      	}
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 2)
			{
	  			format(string, sizeof(string), "~w~%s", tmp);
				GameTextForAll(string, 5000, 3);
				new PlayerName[30];
	 			GetPlayerName(playerid, PlayerName, 30);
				printf("[Command] %s has used /announce with message: %s", PlayerName, tmp);
			}
	 		else
	  		{
	 			SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
        return 1;
	}

	if(strcmp(cmd, "/cnn", true) == 0)
	{

        tmp = strtok(cmdtext, idx, strlen(cmdtext));
 		if (!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 2)
  		{
			SendClientMessage(playerid, COLOR_GREY, "Usage: /cnn [message]");
 			return 1;
      	}
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 2)
			{
	  			format(string, sizeof(string), "~b~%s~r~: ~w~%s", sendername, tmp);
				GameTextForAll(string, 5000, 3);
				new PlayerName[30];
	 			GetPlayerName(playerid, PlayerName, 30);
				printf("[Command] %s has used /cnn with message: %s", PlayerName, tmp);
			}
	 		else
	  		{
				SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
        return 1;
	}
	
	if(strcmp(cmd, "/akill", true) == 0)
	{
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GREY, string);
        giveplayerid = strval(tmp);
		if(PlayerInfo[playerid][pAdmin] < 1)
		{
		    SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
		    return 1;
		}
		if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 1)
		{
			SendClientMessage(playerid, COLOR_GREY, "Usage: /akill [playerid]");
			return 1;
		}
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 1)
			{
			    if(IsPlayerConnected(giveplayerid))
			    {
			    	GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					GetPlayerName(playerid, sendername, sizeof(sendername));
					SetPlayerHealth(giveplayerid, -999);
					format(string, sizeof(string), "AdmCMD: You have murdered %s.", giveplayer);
					SendClientMessage(playerid, COLOR_BLUE, string);
					new PlayerName[30];
					GetPlayerName(playerid, PlayerName, 30);
					printf("[Command] %s has used /akill to kill %s", PlayerName, giveplayer);
					return 1;
				}
				else
				{
				    format(string, sizeof(string), "%d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_RED, string);
				}
			}
			else
			{
	 			SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
	 			return 1;
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
	}

	if(!strcmp(cmdtext, "/admins", true))
	{
	    SendClientMessage(playerid, COLOR_BLUE, "Checking for administrators online...");
		new count=0;
		for(new i=0; i<MAX_PLAYERS; i++)
		{
	    	if(IsPlayerConnected(i))
	    	{
	    	    if(logged[i] == 1)
	    	    {
					if(PlayerInfo[i][pAdmin] >= 1)
					{
						new str[256];
						new pname[24];
						GetPlayerName(i, pname, 24);
						format(str, 256, "Administrator %s [Level %d] ", pname, PlayerInfo[i][pAdmin]);
						SendClientMessage(playerid, COLOR_RED, str);
						count++;
					}
				}
			}
		}
		if(count == 0)
		{
	    	SendClientMessage(playerid, COLOR_RED, "There aren't any administrators online on the server!");
		}
		return 1;
	}

	if(strcmp(cmd, "/tele", true) == 0)
	{
		new telename[MAX_PLAYER_NAME];
		new teleid;
		new Float:pX, Float:pY, Float:pZ;
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 1)
		{
			SendClientMessage(playerid, COLOR_DBLUE, "USAGE: /tele [teleportee id] [destination id]");
			return 1;
		}
		giveplayerid = strval(tmp);
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 1)
		{
			SendClientMessage(playerid, COLOR_DBLUE, "USAGE: /tele [teleportee id] [destination id]");
			return 1;
		}
 		teleid = strval(tmp);
 		if(logged[playerid] == 1)
 		{
	        if(PlayerInfo[playerid][pAdmin] >= 2)
	        {
	            if(IsPlayerConnected(giveplayerid) && IsPlayerConnected(teleid))
	            {
	            	GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					GetPlayerName(playerid, sendername, sizeof(sendername));
					GetPlayerName(teleid, telename, sizeof(telename));
					GetPlayerPos(teleid, pX,pY,pZ);
					SetPlayerPos(giveplayerid, pX,pY,pZ);
					format(string, sizeof(string), "AdmCMD: You teleported %s to %s.", giveplayer,telename);
					SendClientMessage(playerid, COLOR_BLUE, string);
					format(string, sizeof(string), "AdmCMD: You have been teleported to %s by Admin %s.", telename,sendername);
					SendClientMessage(giveplayerid, COLOR_BLUE, string);
					new PlayerName[24];
					GetPlayerName(playerid, PlayerName, 30);
					printf("[Command] %s has used /tele to tele %s to %s", PlayerName, giveplayer, telename);
					return 1;
				}
				else
				{
					if(!IsPlayerConnected(giveplayerid))
					{
						format(string, sizeof(string), "ID:%d is not an active player ID number.", giveplayerid);
						SendClientMessage(playerid, COLOR_RED, string);
					}
					if(!IsPlayerConnected(teleid))
					{
						format(string, sizeof(string), "ID:%d is not an active player ID number.", teleid);
						SendClientMessage(playerid, COLOR_RED, string);
					}
				}
			}
			else
			{
		 		SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}

	if(strcmp(cmd, "/a", true) == 0)
	{
		new length = strlen(cmdtext);
		while ((idx < length) && (cmdtext[idx] <= ' '))
		{
			idx++;
		}
		new offset = idx;
		new result[64];
		while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
		{
			result[idx - offset] = cmdtext[idx];
			idx++;
		}
		result[idx - offset] = EOS;
		if(!strlen(result))
		{
			SendClientMessage(playerid, COLOR_GREY, "USAGE: /a [text] [admin chat]");
			return 1;
		}
		if(logged[playerid] == 1)
		{
			if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
			{
				format(string, sizeof(string), "Admin %s(%i): %s", sendername, playerid, result);
				for(new i = 0; i < MAX_PLAYERS; i ++)
				{
				    if(IsPlayerConnected(i))
				    {
				        if(PlayerInfo[i][pAdmin] >= 1)
				        {
				            SendClientMessage(i,COLOR_BLUE, string);
						}
					}
				}
				printf(string);
	            return 1;
			}
			else
			{
				SendClientMessage(playerid, COLOR_RED, "You aren't able to use administration chat!");
	            return 1;
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
	}

	if(strcmp(cmdtext, "/clearchat", true) == 0)
	{
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 1)
			{
				SendClientMessageToAll(COLOR_SYSTEM, " ");
				SendClientMessageToAll(COLOR_SYSTEM, " ");
				SendClientMessageToAll(COLOR_SYSTEM, " ");
				SendClientMessageToAll(COLOR_SYSTEM, " ");
				SendClientMessageToAll(COLOR_SYSTEM, " ");
				SendClientMessageToAll(COLOR_SYSTEM, " ");
				SendClientMessageToAll(COLOR_SYSTEM, " ");
				SendClientMessageToAll(COLOR_SYSTEM, " ");
				SendClientMessageToAll(COLOR_SYSTEM, " ");
				SendClientMessageToAll(COLOR_SYSTEM, " ");
				SendClientMessageToAll(COLOR_SYSTEM, " ");
				SendClientMessageToAll(COLOR_SYSTEM, " ");
				SendClientMessageToAll(COLOR_SYSTEM, " ");
				SendClientMessageToAll(COLOR_SYSTEM, " ");
				SendClientMessageToAll(COLOR_SYSTEM, " ");
				SendClientMessageToAll(COLOR_SYSTEM, " ");
				GameTextForAll("Chat cleared!", 1000,1);
				new PlayerName[30];
				GetPlayerName(playerid, PlayerName, 30);
				printf("[Command] %s has used /clearchat", PlayerName);
				return 1;
			}
			else
			{
	 			SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
				return 1;
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
	}

	if(strcmp(cmd, "/disarm", true) == 0)
	{
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_DBLUE, "USAGE: /disarm [playerid]");
        giveplayerid = strval(tmp);
		if(logged[playerid] == 1)
		{
			if(PlayerInfo[playerid][pAdmin] >= 3)
			{
			    if(IsPlayerConnected(giveplayerid))
				{
					GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					GetPlayerName(playerid, sendername, sizeof(sendername));
					ResetPlayerWeapons(giveplayerid);
					format(string, sizeof(string), "AdmCMD: Admin %s has disarmed %s.", sendername,giveplayer);
					SendClientMessageToAll(COLOR_BLUE, string);
					format(string, sizeof(string), "AdmCMD: Admin %s disarmed you.", sendername);
					SendClientMessage(giveplayerid, COLOR_BLUE, string);
					new PlayerName[30];
					GetPlayerName(playerid, PlayerName, 30);
					printf("[Command] %s has used /disarm to disarm %s", PlayerName, giveplayer);
				}
				else
				{
	   				format(string, sizeof(string), "%d is not an active player ID number.", giveplayerid);
					SendClientMessage(playerid, COLOR_RED, string);
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
				return 1;
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}

	if(strcmp(cmd, "/disarmall", true) == 0)
	{
        if(logged[playerid] == 1)
        {
			if(PlayerInfo[playerid][pAdmin] >= 3)
			{
			    for(new i = 0; i < MAX_PLAYERS; i ++)
				{
		  			if(IsPlayerConnected(i))
					{
						ResetPlayerWeapons(i);
						format(string, sizeof(string), "AdmCMD: Admin %s has disarmed everyone.", sendername);
						SendClientMessage(i, COLOR_BLUE, string);
						new PlayerName[30];
						GetPlayerName(playerid, PlayerName, 30);
						printf("[Command] %s has used /disarmall to disarm everyone", PlayerName);
					}
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
				return 1;
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}
	
	if(strcmp(cmd, "/healall", true) == 0)
	{
		if(logged[playerid] == 1)
		{
		    if(PlayerInfo[playerid][pAdmin] >= 2)
			{
			    new PlayerName[30];
		 		GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
				printf("[Command] %s has used /healall to heal everyone", PlayerName);
			    for(new i = 0; i < MAX_PLAYERS; i++)
				{
				    SetPlayerHealth(i, 100);
				    format(string, sizeof(string), "AdmCMD: Admin %s has healed everyone.", sendername);
				    SendClientMessage(i, COLOR_BLUE, string);
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}
	
	if(strcmp(cmd, "/armourall", true) == 0)
	{
		if(logged[playerid] == 1)
		{
		    if(PlayerInfo[playerid][pAdmin] >= 2)
			{
			    new PlayerName[30];
  				GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
				printf("[Command] %s has used /armourall to armour everyone.", PlayerName);
			    for(new i = 0; i < MAX_PLAYERS; i++)
				{
				    SetPlayerArmour(i, 100);
				    format(string, sizeof(string), "AdmCMD: Admin %s has armoured everyone.", sendername);
				    SendClientMessage(i, COLOR_BLUE, string);
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}
	
	if(strcmp(cmd, "/ajail", true) == 0)
	{
		new time;
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /ajail [id] [time]");
		giveplayerid = strval(tmp);
		
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /ajail [id] [time]");
		time = strval(tmp);
		
		GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		if(logged[playerid] == 1)
		{
		    if(PlayerInfo[playerid][pAdmin] >= 1)
		    {
				format(string, sizeof(string), "AdmCMD: You've jailed %s(%i)", giveplayer, giveplayerid);
				SendClientMessage(playerid, COLOR_BLUE, string);
				format(string, sizeof(string), "AdmCMD: %s(%i) has jailed you for %d seconds", sendername, playerid, time);
				SendClientMessage(playerid, COLOR_BLUE, string);
				format(string, sizeof(string), "~g~Jailed by ~r~%s", sendername);
				GameTextForPlayer(giveplayerid, string, 1000, 1);
				SetPlayerInterior(giveplayerid, 3);
				SetPlayerPos(giveplayerid, 197.6661,173.8179,1003.0234);
				SetPlayerArmour(giveplayerid, 0);
				TogglePlayerControllable(giveplayerid, 0);
				ResetPlayerWeapons(giveplayerid);
				SetTimerEx("Unjail", time*1000, 0, "i", giveplayerid);
			}
			else
			{
			    SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
		}
		return 1;
	}
	return 0;
}

public IsStringAName(string[])
{
	for(new i = 0; i <= MAX_PLAYERS; i++)
	{
	if(IsPlayerConnected(i) == 1)
	{
		new testname[MAX_PLAYER_NAME];
		GetPlayerName(i, testname, sizeof(testname));
		if(strcmp(testname, string, true, strlen(string)) == 0)
		{
			return 1;
		}
	}
}
	return 0;
}
public GetPlayerID(string[])
{
	for(new i = 0; i <= MAX_PLAYERS; i++)
	{
	if(IsPlayerConnected(i) == 1)
	{
		new testname[MAX_PLAYER_NAME];
		GetPlayerName(i, testname, sizeof(testname));
		if(strcmp(testname, string, true, strlen(string)) == 0)
		{
			return i;
		}
	}
}
	return INVALID_PLAYER_ID;
}
public SendMessageToAdmins(color,const string[])
{
	for(new i = 0; i <= MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i) == 1)
		{
			if (IsPlayerAdmin(i) || PlayerInfo[i][pAdmin] >= 1)
			{
				SendClientMessage(i, color, string);
			}
		}
	}
	return 1;
}
public Restart()
{
    SendRconCommand("gmx");
}
public Unjail(giveplayerid)
{
        //new tmpp[256];
        new giveplayer[MAX_PLAYER_NAME];
		GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		SetPlayerInterior(giveplayerid,0);
		SetPlayerPos(giveplayerid,1546.2803,-1675.6632,13.5620);
		TogglePlayerControllable(giveplayerid,1);
		GameTextForPlayer(giveplayerid, "unjailed", 1000,1);
}
public OnPlayerSelectedMenuRow(playerid, row)
{
	new Menu:Current = GetPlayerMenu(playerid);
	new Float:X,Float:Y,Float:Z,Float:Angle,carid;
	if(Current == Vehicle)
	{
	    switch(row)
		{
			case 0:
	        {
				GetPlayerPos(playerid,X,Y,Z);
				GetPlayerFacingAngle(playerid,Angle);
				carid = CreateVehicle(471,X,Y,Z,Angle,-1,-1,50000);
				PutPlayerInVehicle(playerid,carid,0);
				TogglePlayerControllable(playerid,1);
				if(GetPlayerInterior(playerid)) LinkVehicleToInterior(carid,GetPlayerInterior(playerid));
				SetVehicleVirtualWorld(carid,GetPlayerVirtualWorld(playerid));
			}
			case 1:
	        {
				GetPlayerPos(playerid,X,Y,Z);
				GetPlayerFacingAngle(playerid,Angle);
				carid = CreateVehicle(539,X,Y,Z,Angle,-1,-1,50000);
				PutPlayerInVehicle(playerid,carid,0);
				TogglePlayerControllable(playerid,1);
				if(GetPlayerInterior(playerid)) LinkVehicleToInterior(carid,GetPlayerInterior(playerid));
				SetVehicleVirtualWorld(carid,GetPlayerVirtualWorld(playerid));
			}
	        case 2:
	        {
				GetPlayerPos(playerid,X,Y,Z);
				GetPlayerFacingAngle(playerid,Angle);
				carid = CreateVehicle(441,X,Y,Z,Angle,-1,-1,50000);
				PutPlayerInVehicle(playerid,carid,0);
				TogglePlayerControllable(playerid,1);
				if(GetPlayerInterior(playerid)) LinkVehicleToInterior(carid,GetPlayerInterior(playerid));
				SetVehicleVirtualWorld(carid,GetPlayerVirtualWorld(playerid));
			}
	        case 3:
	        {
				GetPlayerPos(playerid,X,Y,Z);
				GetPlayerFacingAngle(playerid,Angle);
				carid = CreateVehicle(495,X,Y,Z,Angle,-1,-1,50000);
				PutPlayerInVehicle(playerid,carid,0);
				TogglePlayerControllable(playerid,1);
				if(GetPlayerInterior(playerid)) LinkVehicleToInterior(carid,GetPlayerInterior(playerid));
				SetVehicleVirtualWorld(carid,GetPlayerVirtualWorld(playerid));
			}
	        case 4:
	        {
      			GetPlayerPos(playerid,X,Y,Z);
				GetPlayerFacingAngle(playerid,Angle);
				carid = CreateVehicle(520,X,Y,Z,Angle,-1,-1,50000);
				PutPlayerInVehicle(playerid,carid,0);
				TogglePlayerControllable(playerid,1);
				if(GetPlayerInterior(playerid)) LinkVehicleToInterior(carid,GetPlayerInterior(playerid));
				SetVehicleVirtualWorld(carid,GetPlayerVirtualWorld(playerid));
			}
	        case 5:
	        {
                GetPlayerPos(playerid,X,Y,Z);
				GetPlayerFacingAngle(playerid,Angle);
				CreateVehicle(411,X,Y,Z,Angle,-1,-1,50000);
				PutPlayerInVehicle(playerid,carid,0);
				TogglePlayerControllable(playerid,1);
				if(GetPlayerInterior(playerid)) LinkVehicleToInterior(carid,GetPlayerInterior(playerid));
				SetVehicleVirtualWorld(carid,GetPlayerVirtualWorld(playerid));
			}
	        case 6:
	        {
  				GetPlayerPos(playerid,X,Y,Z);
				GetPlayerFacingAngle(playerid,Angle);
				carid = CreateVehicle(443,X,Y,Z,Angle,-1,-1,50000);
				PutPlayerInVehicle(playerid,carid,0);
				TogglePlayerControllable(playerid,1);
				if(GetPlayerInterior(playerid)) LinkVehicleToInterior(carid,GetPlayerInterior(playerid));
				SetVehicleVirtualWorld(carid,GetPlayerVirtualWorld(playerid));
			}
	        case 7:
	        {
  				GetPlayerPos(playerid,X,Y,Z);
				GetPlayerFacingAngle(playerid,Angle);
				carid = CreateVehicle(502,X,Y,Z,Angle,-1,-1,50000);
				PutPlayerInVehicle(playerid,carid,0);
				TogglePlayerControllable(playerid,1);
				if(GetPlayerInterior(playerid)) LinkVehicleToInterior(carid,GetPlayerInterior(playerid));
				SetVehicleVirtualWorld(carid,GetPlayerVirtualWorld(playerid));
			}
	        case 8:
	        {
  				GetPlayerPos(playerid,X,Y,Z);
				GetPlayerFacingAngle(playerid,Angle);
				carid = CreateVehicle(572,X,Y,Z,Angle,-1,-1,50000);
				PutPlayerInVehicle(playerid,carid,0);
				TogglePlayerControllable(playerid,1);
				if(GetPlayerInterior(playerid)) LinkVehicleToInterior(carid,GetPlayerInterior(playerid));
				SetVehicleVirtualWorld(carid,GetPlayerVirtualWorld(playerid));
			}
   			case 9:
	        {
  				GetPlayerPos(playerid,X,Y,Z);
				GetPlayerFacingAngle(playerid,Angle);
				carid = CreateVehicle(557,X,Y,Z,Angle,-1,-1,50000);
				PutPlayerInVehicle(playerid,carid,0);
				TogglePlayerControllable(playerid,1);
				if(GetPlayerInterior(playerid)) LinkVehicleToInterior(carid,GetPlayerInterior(playerid));
				SetVehicleVirtualWorld(carid,GetPlayerVirtualWorld(playerid));
			}
			case 10:
	        {
  				GetPlayerPos(playerid,X,Y,Z);
				GetPlayerFacingAngle(playerid,Angle);
				carid = CreateVehicle(483,X,Y,Z,Angle,-1,-1,50000);
				PutPlayerInVehicle(playerid,carid,0);
				TogglePlayerControllable(playerid,1);
				if(GetPlayerInterior(playerid)) LinkVehicleToInterior(carid,GetPlayerInterior(playerid));
				SetVehicleVirtualWorld(carid,GetPlayerVirtualWorld(playerid));
			}
			case 11:
	        {
  				GetPlayerPos(playerid,X,Y,Z);
				GetPlayerFacingAngle(playerid,Angle);
				carid = CreateVehicle(522,X,Y,Z,Angle,-1,-1,50000);
				PutPlayerInVehicle(playerid,carid,0);
				TogglePlayerControllable(playerid,1);
				if(GetPlayerInterior(playerid)) LinkVehicleToInterior(carid,GetPlayerInterior(playerid));
				SetVehicleVirtualWorld(carid,GetPlayerVirtualWorld(playerid));
			}
		}
		OnPlayerExitedMenu(playerid);
	}
}
public OnPlayerExitedMenu(playerid)
{
    TogglePlayerControllable(playerid, 1);
	return 1;
}

